package com.demo.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.demo.data.Result;
import com.demo.entity.TOrgTel;
import com.demo.service.ITOrgTelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * insert into t_org_tel
select o.id,o.id,o.orgname,o.telephone,o.district,(select d.code_desc from t_pa_dic d where d.type='district' and d.code=o.district) from t_pa_org o where o.sidetype='2' and o.id not like '%DISTRICT%' and o.id not in (select tel.orgid from t_org_tel tel)
 前端控制器
 * </p>
 *
 * @author author
 * @since 2022-08-04
 */
@RestController
@RequestMapping("/t-org-tel")
public class TOrgTelController {


    @Autowired
    private ITOrgTelService itOrgTelService;

    @GetMapping("/getPage")
    public Result getPage(@RequestParam(defaultValue = "1")Integer pageNum,
                          @RequestParam(defaultValue = "5")Integer pageSize){
        IPage<TOrgTel> tOrgTelIPage = itOrgTelService.selectPage(pageNum , pageSize);
        return Result.ok().setData(tOrgTelIPage);
    }
}
